default: all

all: lib

CC:=g++ 
CFLAGS:= $(CPPFLAGS)
AR:=ar
ARFLAGS:= cru
LIBNAME:= libstatemanagement.a
RANLIB:=ranlib
INCS:= -I.
LIBDIRS:= -L.
LIBS:= -lbyz
LIBBYZ:= libbyz.a

#CPPFLAGS:= $(INCS) -g -Wall -O3 -pedantic
CPPFLAGS:= $(INCS) -g -O3 -Wall -pedantic #-pg

C_FILES= $(wildcard *.cc)

H_FILES := $(C_FILES:%.cc=%.hpp) ../constants.hpp 

%.o:: %.cc
	$(CC) $(CPPFLAGS) -o $@ -c $<

OBJ_FILES:=$(C_FILES:%.cc=%.o) 
#$(c_FILES:%.c=%.o)

objs: $(OBJ_FILES)

lib: $(LIBNAME)

$(LIBNAME): objs
	$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ_FILES)

clean:
	-rm  -f *.o
	-rm  -f *~ 
	-rm  -f *.a
